/* SPDX-License-Identifier: GPL-2.0 */

/**
 * Copyright (C) 2025 Huawei Technologies Co., Ltd.
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, see <https://www.gnu.org/licenses/>.
 *
 * @file hw_regs_access.h
 * @brief Hisilicon HW registers access related definitions
 */

#ifndef HW_REGS_ACCESS_H
#define HW_REGS_ACCESS_H

#include <linux/module.h>

MODULE_LICENSE("GPL");

/**
 * Definition for core registers READ functions declarations
 */
#define READ_CORE_REG_FUNC_DECL(name) \
u64 cman_drv_##name##_read(void);

/**
 * Definition for core registers WRITE functions declarations
 */
#define WRITE_CORE_REG_FUNC_DECL(name) \
bool cman_drv_##name##_write(u64 val);

/**
 * Current Cache Size ID Register
 */
READ_CORE_REG_FUNC_DECL(ccsidr_el1)
WRITE_CORE_REG_FUNC_DECL(ccsidr_el1)

/**
 * Current Cache Size ID Register 2
 */
READ_CORE_REG_FUNC_DECL(ccsidr2_el1)
WRITE_CORE_REG_FUNC_DECL(ccsidr2_el1)

/**
 * Cache Size Selection Register
 */
READ_CORE_REG_FUNC_DECL(csselr_el1)
WRITE_CORE_REG_FUNC_DECL(csselr_el1)

/**
 * L2 I/D Partition Control Register
 */
READ_CORE_REG_FUNC_DECL(l2_partition_reg)
WRITE_CORE_REG_FUNC_DECL(l2_partition_reg)

/**
 * Memory Model Feature Register 2
 */
READ_CORE_REG_FUNC_DECL(memory_model_feature_reg)
WRITE_CORE_REG_FUNC_DECL(memory_model_feature_reg)

#endif /* HW_REGS_ACCESS_H */
